package com.qf.Web.Servlet;

import com.alibaba.fastjson.JSON;
import com.qf.Domain.GoodsType;
import com.qf.Service.GoodsTypeService;
import com.qf.Service.Impl.GoodsTypeServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/*
 *
 */
@WebServlet(name = "GoodsTypeServlet",value = "/goodstypeservlet")
public class GoodsTypeServlet extends BaseServlet {
    public String goodstypelist(HttpServletRequest request, HttpServletResponse response) throws Exception{
        response.setContentType("application/json;charset=utf-8");
        GoodsTypeService goodsTypeService=new GoodsTypeServiceImpl();
        List<GoodsType> list=goodsTypeService.fing(1);
        String jsonString = JSON.toJSONString(list);
        response.getWriter().write(jsonString);
        return null;
    }
}
